angular.module('search',[])
.config(['$routeProvider',function($routeProvider){
	$routeProvider
	.when('/search',{
		templateUrl:'html/search/search.html',
		css:'html/search/search.css'
	})
}])
.controller('searchCtrl',function($scope,$http,$rootScope){
	//头部和底部显示隐藏
	$rootScope.sh = true;
	//数据
	$http.get('http://www.yanhanbo.top/user/origin.php?names=&imgs=&standard=&genre=&delivery=&price=&type=%E6%89%80%E6%9C%89').then(function(data){
		$scope.list = data.data.data;

	})
	//详情页传值
	$rootScope.arr2 = [];
	$scope.dianji = function(x){
		$rootScope.arr2.push(x);
		localStorage.arrr = JSON.stringify($rootScope.arr2);
	}
	//价格排序
	$scope.price = function(){
		$scope.arr.sort(function(a,b){
			return a.price - b.price;
		})
	}
	$scope.price1 = function(){
		$scope.arr.sort(function(a,b){
			return b.price - a.price;
		})
	}
	
//	$scope.msg = '我是原产地页面'
	$(".sp1").click(function(){
		if($(this).html() == "-"){
			$(this).html("+")
		}else{
			$(this).html("-")
		}
	})
	$(".divv").click(function(){
		$(this).prependTo($(".zuo"))
		$(this).find(".la").show()
		$(this).siblings().children(".la").hide()
		$(".cb").html($(".pp").html())
	})
	$(".suos input").focus(function(){
		console.log(1)
		$(this).placeholder == "";
	})
	$(".ppp1 input").click(function(){
		$(".inp").css({
			color:'#fff',
			background:'red'
		})
	})
	$(".dx").click(function(){
		$(".bao").hide();
		$(".bao2").show();
		$(".kong1").show()
	})
	$(".qux").click(function(){
		$(".bao").show();
		$(".bao2").hide();
		$(".kong1").hide()
	})
	$(".paix span").click(function(){
		$(this).css({
			color:'#fff',
			background:'red'
		}).siblings().css({
			color:'#000',
			background:'#f7f7f7'
		})
		
	})


})